package com.sun.app.process.front.home;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sun.app.process.BaseProcess;
import com.sun.app.process.PagingBaseProcess;
import com.sun.core.common.PagingList;

public class CommonActivityProcess extends PagingBaseProcess{


	@Override
	public HashMap<String, Object> execute(HttpServletRequest request,
			HttpServletResponse response, HashMap<String, Object> model)
			throws Exception {
		// TODO Auto-generated method stub
		//PagingList p  = getServMgr().getFriendService().getFriendPageList(request);
		String UID;
		String homePersonId;
		try {
			UID = (String) request.getSession().getAttribute("UID");
			homePersonId=request.getParameter("homePersonId");
			System.out.println("homePersonId----->"+homePersonId);
			//未登录
			if(UID==null ){
				this.setSuccessView("login");
				return model;
			}
			else{
				this.setSuccessView("front/home/commonActivity");
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			this.setSuccessView("login");
			return model;
		}
		Map user = getServMgr().getUserService().getUserById(UID,homePersonId);
		//PagingList friends = getServMgr().getFriendService().getFriendPageList(request);
		System.out.println(user);
		model.put("user", user);
		return model;
	}

}
